import { post, get, _delete, put } from '@/lin/plugin/axios'

class Gateway {
  static async addGateway(data) {
    const res = await post('v1/ag/gateway/create', data)
    return res
  }

  static async getGateway(id) {
    const res = await get(`v1/ag/gateway/${id}`)
    return res
  }

  static async editGateway(id, data) {
    const res = await put(`/v1/ag/gateway/${id}`, data)
    return res
  }

  static async deleteGateway(id) {
    const res = await _delete(`v1/ag/gateway/${id}`)
    return res
  }

  static async getGateways(page = 0, count = 10) {
    const res = await get('v1/ag/gateway/page', { page, count })
    return res
  }

  static async search({keyword,page,count}){
    const res = await get('v1/ag/gateway/search',{
      keyword,
      page,
      count
    })
    return res
  }

}

export default Gateway
